/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.sql.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 *
 * @author andrea
 */
@Entity
public class Weather implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /*---------------------primary key-----------------------------------------*/
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long weatherID;
    
    /*---------------------attribute-----------------------------------------*/
    private Date startDate;
    private Date endDate;

    /*---------------------getter & setter-----------------------------------------*/
    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Long getWeatherID() {
        return weatherID;
    }

    /*------------------------------------------------------------------------*/
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (weatherID != null ? weatherID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Weather)) {
            return false;
        }
        Weather other = (Weather) object;
        if ((this.weatherID == null && other.weatherID != null) || (this.weatherID != null && !this.weatherID.equals(other.weatherID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Weather[ id=" + weatherID + " ]";
    }
    
}
